summaryrefslogtreecommitdiff
path: root/src/pages/micro/[...page].astro
diff options
context:
space:
mode:
authorDawid Rycerz <dawid@rycerz.xyz>2025-07-03 13:59:59 +0300
committerDawid Rycerz <dawid@rycerz.xyz>2025-07-03 13:59:59 +0300
commit4b9018b6d92ef8f1854d9dc44625295c2acd3fb3 (patch)
tree10e01ec849c7439befd0a21f04021213e98d0f94 /src/pages/micro/[...page].astro
parentf100d259d2ffebe61fef56ea3964f6d534d598c8 (diff)
Cleanup old notes feature
Diffstat (limited to 'src/pages/micro/[...page].astro')
-rw-r--r--src/pages/micro/[...page].astro14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/pages/micro/[...page].astro b/src/pages/micro/[...page].astro
index b4e3e07..edfecab 100644
--- a/src/pages/micro/[...page].astro
+++ b/src/pages/micro/[...page].astro
@@ -5,19 +5,15 @@ import { Icon } from "astro-icon/components";
import Note from "@/components/note/Note.astro";
import Pagination from "@/components/Paginator.astro";
import PageLayout from "@/layouts/Base.astro";
-import { collectionDateSort } from "@/utils/date";
export const getStaticPaths = (async ({ paginate }) => {
const MAX_MICRO_PER_PAGE = 10;
- // Get both local notes and Pleroma posts
- const [allNotes, allMicro] = await Promise.all([
- getCollection("note"),
- getCollection("micro").catch(() => []), // Fallback to empty array if micro collection fails
- ]);
+ // Get only Pleroma posts
+ const allMicro = await getCollection("micro").catch(() => []); // Fallback to empty array if micro collection fails
- // Combine and sort all micro posts
- const allMicroPosts = [...allNotes, ...allMicro].sort(
+ // Sort all micro posts
+ const allMicroPosts = allMicro.sort(
(a, b) => b.data.publishDate.getTime() - a.data.publishDate.getTime(),
);
@@ -25,7 +21,7 @@ export const getStaticPaths = (async ({ paginate }) => {
}) satisfies GetStaticPaths;
interface Props {
- page: Page<CollectionEntry<"note"> | CollectionEntry<"micro">>;
+ page: Page<CollectionEntry<"micro">>;
uniqueTags: string[];
}